<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .sile{display: none;
    position: absolute;
    width: 200px;
    height: 200px;
    left: 300px;
    text-align: center;
    top:100px;
    background-color:yellow;
    }
    .sile button{
      
        width: 100%;
        height: 100%;
    }
    </style>
<body>
    <div class="map"></div>


    <button class="start">开始</button>
    <button class="stop">停止</button>
    <div class="sile"> <button>你死了，点击重新开始</button></div>
    <script src="./snake.js"></script>
    <script src="./food.js"></script>
    <script src="./map.js"></script>
    <script src="./game.js"></script>
    
    <script>
    const g = new Game('.map')
    
    const start = document.querySelector('.start')
    const stop = document.querySelector('.stop')
    start.addEventListener('click', () => g.start())
    stop.addEventListener('click', () => g.stop())
    </script>   
</body>
</html>
